<extend name="Index:base" />
<block name="title"><title>首页促销区</title></block>
<block name="style">
 <style>
.main,.panel-default>.panel-heading{
background:none;
}
body{
background:none;
}
.panel.panel-default,.panel .panel-body,.panel .panel-heading,.table-bordered {
	border:none;
}
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
	border:none;		
	padding:15px;	
	line-height:8px;
	height: 8px;
	border-top: 1px solid #d4d4d4;
	border-bottom: 1px solid #d4d4d4;
}
.name strong{
color:#000000;
font-size:15px;
font-weight:600;
}
.name {
	color:#20a8d8;
	font-size:12px;
}
.smallfont {
	color:#9c9c9c;
	font-size:12px;
}

.align-center{
	text-align:center; 
}
.title2{
text-align:center;
}
.table-bordered > tbody > tr .wd{
	text-align:left;	
}

.col-xs-2,.col-xs-4{
padding-right:0;
margin:10px 0;
}
.col-sm-3{
width:10%;
}
.col-sm-2{
width:8%;
}
.col-sm-1{
width:5%;
}
.col-sm-4{
width:18%;
}
.col-sm-1,.col-sm-2{
margin:16px 0;
}
.col-sm-3,.col-sm-4{
margin:10px 0;
}
.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4{
padding-right:0;
}
 </style>

</block>
	<!-- start: Header -->
<block name="body">

			<!-- end: Main Menu -->
						
		<!-- start: Content -->
		<div class="main ">
		
			<div class="row">
				<div class="col-lg-12">
					<h3 class="page-header"><i class="fa fa-life-bouy"></i>首页促销区</h3>
				</div>
			</div>

			<div class="row">				
				<div class="col-lg-12">
					<div class="panel panel-default">
						<div class="panel-heading">
							<h2><span class="break"></span><strong>促销区</strong></h2>
							&nbsp;&nbsp;&nbsp;
							<a class="btn btn-default " href="#" id="sales_add">新增促销区</i></a>
												
						</div>&nbsp;&nbsp;&nbsp;
						<ol class="breadcrumb" style="height:55px;background-color: #ffffff;">							
							<li><i class="fa fa-warning"></i><a href="#">操作提示：</a></li><br/>	
							<li><font style="font-size:8px;color:#888;">最多可以加五组，每组五个商品。</font></br>
							
							</li>							
						</ol>
					</div>
				</div><!--/col
			
			</div><!--/row-->				
			
		<!-- end: Content -->
		<br><br><br>
		
	</div><!--/container-->
		<foreach name="prom_list" item="vo">
		<div class="row">			
				<div class="col-lg-10">                           
                    <div class="panel panel-default">                                
						<div class="panel-heading" style="background-color: #e0f4fd;">
							<h2><span class="break"></span><strong>{$vo.se_name}	</strong></h2>
							<div class="panel-actions">
								<a href="{:U('Index/home_sales')}?id={$vo.se_id}&sales_add=sales_add&html=sales_add">&nbsp;&nbsp;编辑&nbsp;&nbsp;</a>
								<a href="#" data-sdel="sales_del" data-type="del" data-id="{$vo.se_id}">&nbsp;&nbsp;<i class="fa fa-times"></i>&nbsp;&nbsp;</a>
							</div>
						</div>
                                
                        <div class="panel-body">
                            <table class="table table-hover">
                                <tbody>
                                    <tr>
										<td>	
											<foreach name="vo.goods" item="gvo">
											<div style="" class="col-md-2">
												<img class="img-thumbnail" src="{$gvo.pic}" style="width:140px;height:140px;" />
											</div>
											</foreach>										
										</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>                 
				</div><!--/col-->
			</div>
			</foreach>
			
			</br/>
			</br/>
			</br/>
			</br/>
			</br/>
			</br/>
	
</block>
<block name="script">
<script>
$("#sales_add").click(function(){
	
	window.location.href ="{:U('Index/home_sales')}?sales_add=sales_add&html=sales_add";	
});


$('[data-sdel="sales_del"]').click(function(){

    var id = $(this).attr('data-id');
	var type = $(this).attr('data-type');
	//alert(type);
	if (type=='del') {
		if(confirm("确定要删除吗？")){		
			//是	
			$.ajax({
				url:"{:U('Store/del')}",
				data:{id:id,table:6,str:'se_id'},
				type:'post',
				dataType:'json',
				success:function (e) {			
				
					alert(e.info); 
					location.reload();				
				}
			});			
		}else{
			//否
			return false;
		}	
	}

});
</script>
</block>	









